package oop.ex2.tokenizer;

import oop.ex2.expression.ConstantNode;
import oop.ex2.expression.ExpressionNode;

/**
 * This subclass searches for a double number constant and generates a ConstantNode.
 * @author daniel_i_l
 *
 */
public class ConstantAnalyzer extends TokenAnalyzer {
	private static final String PATTERN = "([0-9][0-9]*)(\\.[0-9][0-9]*)?" ;
	
	/**
	 * Construct a constant analyzer.
	 */
	public ConstantAnalyzer() {
		super(PATTERN);
	}

	@Override
	public ExpressionNode getExpressionNode() {
		return new ConstantNode(_matchedString);
	}

}
